﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Text;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DIWAGIS.Class;


namespace DIWAGIS.ApplicationLayer.BanDo
{
    public partial class frmAttributeShowTipLayer : Form
    {
        public frmAttributeShowTipLayer()
        {
            InitializeComponent();
        }

        private void frmAttributeShowTipLayer_Load(object sender, EventArgs e)
        {
            for (int i = 5; i <= 120; i++) this.sizecomboBox.Items.Add(i);
            InstalledFontCollection installedFontCollection = new InstalledFontCollection();

            // Get the array of FontFamily objects into ComboBox.
            FontFamily[] fontFamilies;
            fontFamilies = installedFontCollection.Families;
            int count = fontFamilies.Length;
            for (int i = 0; i < fontFamilies.Length; ++i)
            {
                this.fontcomboBox.Items.Add(fontFamilies[i].Name);
            }
            sizecomboBox.SelectedIndex = 0;
        }

        private void colorbutton_Click(object sender, EventArgs e)
        {
            // Show the color dialog.
            colorDialog1.AllowFullOpen = true;
            DialogResult result = colorDialog1.ShowDialog();
            // See if user pressed ok.
            if (result == DialogResult.OK)
            {
                // Set form background to the selected color.
                this.colortextBox.BackColor = colorDialog1.Color;
                this.colortextBox.Text = "R:" + colorDialog1.Color.R.ToString() + "; B:" + colorDialog1.Color.B.ToString() + "; G:" + colorDialog1.Color.G.ToString();
                ClassVariables.labelRed = colorDialog1.Color.R;
                ClassVariables.labelBlue = colorDialog1.Color.B;
                ClassVariables.labelGreen = colorDialog1.Color.G;
            }
        }

        private void dongYbutton_Click(object sender, EventArgs e)
        {
            if (sizecomboBox.Text.Trim() != "") ClassVariables.labelSize = Convert.ToInt32(sizecomboBox.Text.Trim());
            if (fontcomboBox.Text.Trim() != "") ClassVariables.labelFont = fontcomboBox.Text.Trim();
            if (boldcheckBox.Checked == true) ClassVariables.labelBold = true;
            if (italiccheckBox.Checked == false) ClassVariables.labelItalic = false;
            this.Close();
        }

        private void huyBobutton_Click(object sender, EventArgs e)
        {
            ClassVariables.labelRed = 0;
            ClassVariables.labelBlue = 0;
            ClassVariables.labelGreen = 0;
            this.Close();
        }
    }
}
